<?php
include_once($_SERVER['DOCUMENT_ROOT']."/BT32/database/database.php");
include_once($_SERVER['DOCUMENT_ROOT'].'/BT32/Models/nguoidung.php');

class llgv extends NguoiDung{
	private $tengv;
	private $ngaysinh;
	private $gioitinh;
	private $chucvu;
	private $sdt;
	private $email;
	private $diachi;

	public function settengv($tengv){
		$this->tengv = $tengv;
	}

	public function setngaysinh($ngaysinh){
		$this->ngaysinh = $ngaysinh;
	}

	public function setgioitinh($gioitinh){
		$this->gioitinh = $gioitinh;
	}

	public function setchucvu($chucvu){
		$this->chucvu = $chucvu;
	}

	public function setsdt($sdt){
		$this->sdt =$sdt;		
	}

	public function setemail($email){
		$this->email = $email;
	}

	public function setdiachi($diachi){
		$this->diachi = $diachi;
	}

	public function gettengv(){
		return $this->tengv;
	}
	
	public function getngaysinh(){
		return $this->ngaysinh;
	}

	public function getgioitinh(){
		return $this->gioitinh;
	}

	public function getchucvu(){
		return $this->chucvu;
	}

	public function getsdt(){
		return $this->sdt;
	}

	public function getemail(){
		return $this->email;
	}

	public function getdiachi(){
		return $this->diachi;
	}

	public function themgv(){
		$query = "insert into llgv(magv, tengv, ngaysinh, gioitinh, chucvu, sdt, email, diachi) values 
		('". $this->getmagv() ."', '". $this->gettengv() ."', '". $this->getngaysinh() ."', '". $this->getgioitinh() ."' , '". $this->getchucvu() ."', '". $this->getsdt() ."', '". $this->getemail() ."', '". $this->getdiachi() ."')";
		$this->setQuery($query);
        return $this->executeQuery();
	}

	public function suagv(){
		$query = "update llgv set tengv='". $this->gettengv() ."', ngaysinh='". $this->getngaysinh() ."', gioitinh='". $this->getgioitinh() ."', chucvu='". $this->getchucvu() ."', sdt='". $this->getsdt() ."', email='". $this->getemail() ."', diachi='". $this->getdiachi() ."'";
		$query .= " where magv = '". $this->getmagv() ."'";
		$this->setQuery($query);
        return $this->executeQuery();
	}

	public function xoagv(){
		$this->setQuery("delete from llgv where magv='".$this->getmagv()."'");
		$this->setQuery($query);
        return $this->executeQuery();
	}

	public function dsgv(){
		$this->setQuery("select * from llgv");
		return $this->fetchAll();
	}

	// còn danh sách giáo viên bộ môn
	// ban giám hiệu
	// tổ trưởng
	// gv có chủ nhiệm
}
?>
